from unisdk.sms import UniSMS
from unisdk.exception import UniException

# 初始化
client = UniSMS("PYf2TUpJosJgP97MMMUTwziPRKJyyWBbuYm85JrQyhG5fjCLm") # 若使用简易验签模式仅传入第一个参数即可

try:
  # 发送短信
  res = client.send({
    "to": "13068254894", # 收件手机号
    "signature": "大冬冬哟", # 短信签名
    "templateId": "pub_verif_basic", # 短信正文文本
    "templateData": {
      "code": 4432
    }
  })
  print(res.data)
except UniException as e:
  print(e)